<template>
	<view class="" style="width: 100vw;height: 100vh">
		<!-- <view  style="min-height: 100vh"> -->
		<view class="content" :style="{'background':kbackgroundColor}" style="min-height: 100vh">
		
			<!-- <image src="/static/login/login_bg.png" mode="scaleToFill" class="user_bg"></image> -->
			<hx-navbar title=" " :back="true" :fixed="true" :color="knavTitleColor" barPlaceholder="hidden"
				transparent="auto"></hx-navbar>
			<!-- <image src="/static/login/log_bg.png" mode="scaleToFill" class="bg"></image> -->
			<view class="forget-title" :style="{color:selectColorSize}">忘记密码</view>

			<view class="input_box">
				<view class="input_boxx notBtm">
					<!-- <view class="input_title">
					手机号
				</view> -->
					<view class="input_panel">
						<!-- <view class="input_left">
						+86
					</view> -->
						<input type="text" class="inputer" placeholder-class="inputer_placeholder" placeholder="请输入手机号"
							v-model="mobile" :maxlength="maxMobile">
					</view>
				</view>

				<view class="login_btn forget" @click="toCode()" :style="{background:buttonBcak}">
					<text>
						获取验证码
					</text>
				</view>
				<view class="agree_box forget"  @tap="agree()">
					<radio :checked="is_agree" style="transform: scale(.6);" />
					我已同意金币世界<text :style="{color:selectColorSize}" @click="goAgreement()">《用户隐私协议》</text>及
					<text :style="{color:selectColorSize}" @click="goPrivacy()">《服务协议》</text>
				</view>
			<!-- 请阅读并同意用户隐私协议和服务协议! -->	<uni-popup ref="confirmDialog" type="center" :maskBackgroundColor="'rgba(0,0,0,0.5)'" :isMaskClick="false">			<view class="store-view store-border-all tips-padding"				:style="{'background':kbackgroundColor,color:knormalColor}"				:class="[{'alert-border-black alert-border-shadow-black':ktheme =='black'},{'alert-border-purple':ktheme =='purple'}]">				<text class="popup-title">提示</text>				<text class="popup-subtitle">请阅读并同意用户隐私协议和服务协议!?</text>				<view class="tips-bottom">					<view class="tips-button"						:class="[{'tips-cancel-bg-black':ktheme =='black'},{'tips-cancel-bg-white':ktheme =='purple'}]"						@click="colfirmClose()">关闭</view>					<view class="tips-button" :style="{background:kbuttonBgColor}" @click="confirmCheck()">确定勾选</view>				</view>			</view>		</uni-popup>

			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				selectColorSize: this.$store.state.selectColorSize, //字体
				buttonBcak: this.$store.state.buttonBcak, //按钮颜色
				is_agree: false,
				maxMobile: 11,
				mobile: ''
			}
		},
		onLoad(options) {
			this.mobile = options.mobile
		},
		methods: {
				// 关闭			colfirmClose(){					this.$refs.confirmDialog.close()			},			// 确定勾选			confirmCheck(){				this.is_agree =true				this.$refs.confirmDialog.close()							},
			// 跳转到用户协议
			goAgreement() {
				let articleId = this.$store.state.config.user_agreement_id;
				this.$common.navigateTo('/pages/article/index?id_type=1&id=' + articleId);
			},
			// 跳转到隐私政策
			goPrivacy() {
				let articleId = this.$store.state.config.privacy_policy_id;
				this.$common.navigateTo('/pages/article/index?id_type=1&id=' + articleId);
			},
			agree: function() {
				this.is_agree = !this.is_agree
			},
			toCode() {
				// if (this.mobile == '') {
				// 	this.$common.errorToShow('手机号不能为空!');
				// } else if(!this.is_agree){
				// 	this.$common.errorToShow('请阅读并同意用户隐私协议和服务协议!');
				// } else{
				// 	this.$common.navigateTo('/pages/user/settings/forget/forget-code?mobile=' + this.mobile)
				// }
				if (this.mobile == '') {
					this.$common.errorToShow('手机号不能为空!');
				}else if (!/^1[3456789]{1}\d{9}$/gi.test(this.mobile)) {
					this.$common.errorToShow('请输入正确手机号');
				}  else if (!this.is_agree) {
						this.$refs.confirmDialog.open()
// this.$common.errorToShow('请阅读并同意用户隐私协议和服务协议!');
				} else {
					this.$common.navigateTo('/pages/user/settings/forget/forget-code?mobile=' + this.mobile)
				}

			}
		}
	}
</script>
<style>
	@import '/pages/login/login.css';
</style>